import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 供应商信息
 */
@Entity('supplier_supplier')
export class SupplierSupplierEntity extends BaseEntity {
  @Index()
  @Column({ comment: '名称', length: 255 })
  name: string;

  @Column({ comment: '等级', dict: ['普通', 'VIP', '战略'], default: 0 })
  level: number;

  @Column({ comment: '联系人', length: 50 })
  contactPerson: string;

  @Index()
  @Column({ comment: '联系电话', length: 20 })
  contactPhone: string;

  @Column({ comment: '省', nullable: true })
  province: string;

  @Column({ comment: '市', nullable: true })
  city: string;

  @Column({ comment: '区', nullable: true })
  district: string;

  @Column({ comment: '详细地址', length: 255, nullable: true })
  address: string;

  @Column({ comment: '状态', dict: ['停用', '启用'], default: 1 })
  status: number;

  @Column({ comment: '备注', type: 'text', nullable: true })
  remark: string;
}
